import sys
from pathlib import Path

base_path = str(Path(__file__).resolve().parent.parent)
sys.path.append(base_path)
from langchain_community.document_loaders import PyPDFLoader

pdf_loader = PyPDFLoader(
    file_path=f"{base_path}/data/1.JavaScript面试真题-210页.pdf",
    password=None,
    extract_images=False,
)

docs = pdf_loader.load()
# print(type(docs))
# print(len(docs))
print(docs[1].page_content)
print(docs[1].metadata)
